<template>
  <div class="hello-main">
    <sideMenu :isShow="isShow" @showMethod="showMethod"></sideMenu>
    <div class="content-wrapper" :class="{'show-content-wrapper': isShow}">
       <div class="header">
          <span>{{msg}}</span>
          <div class="item">111</div>
       </div>
      <div class="footer">
        <mt-button type="danger" @click="getData">danger</mt-button><br>
        <mt-button  @click="jumpMethod">jumpMethod</mt-button><br>
        <mt-button type="primary" @click="showMethod">显示</mt-button><br>
      </div>
    </div>
  </div>
</template>

<script>
import sideMenu from "./sideMenu.vue"
export default {
  name: 'HelloWorld',
  data () {
    return {
      msg: 'Welcome',
      isShow: false
    }
  },
  methods: {
    async getData() {
      let dataes = {"platform":"ued","device":"pc"}
      let res = await this.axios.post(this.api.getJackpot,dataes)
      if (res){
        console.log("结果:",res)
      }

    },
    init(...aa) {
      let arr = [20,25,33];
      let newArr = arr.filter(function(num,index,arr){
        if(num%2===0){
          return num*2
        }
      })
      console.log(newArr,aa)
    },
    jumpMethod() {
      this.$router.push('/a')
    },
    showMethod() {
      this.isShow = !this.isShow
    }
  },
  mounted(){
    this.storage.set({
      aa: 'bb'
    })
    console.log(this.$.getTime())
    this.init(11,22,33)
  },
  components: {
    sideMenu
  }
}
</script>
<style lang="scss">
  .hello-main{
    .content-wrapper{
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      width: 100%;
      transition: all .3s linear;
    }
    .show-content-wrapper{
      left: 6rem;
    }
    
  }
</style>
